Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AST getAll[Supported]Versions and isSupportedVersion #3567

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

akurtakov
Copy link
Contributor

New methods to ease finding all/supported JLS versions. Supported JLS versions helpers are needed in order ease limiting AST support to what compiler supports.

@akurtakov
Copy link
Contributor Author

eclipse-jdt/eclipse.jdt.ui#1948 is an example of usage of new API.

@akurtakov
Copy link
Contributor Author

@iloveeclipse IIRC you added the similar API in JavaCore so would you please take a look.

@@ -1193,7 +1204,7 @@ private AST(int level, boolean previewEnabled) {
false/*isPreviewEnabled*/);
break;
default:
if (level < JLS2_INTERNAL && level > JLS_Latest) {
if (!ALL_VERSIONS.contains(level)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be SUPPORTED_VERSIONS ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using SUPPORTED_VERSIONS should happen in #3533 together with switching the mapping to prevent inconsistencies.

Copy link
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I've never worked within AST area, so no idea what is supposed to be supported or not. So would be nice if someone familiar with AST could review too,

@akurtakov
Copy link
Contributor Author

I'll wait Monday and push it if no one jumps in.

New methods to ease finding all/supported JLS versions. Supported JLS
versions helpers are needed in order ease limiting AST support to what
compiler supports.
@akurtakov akurtakov merged commit cc53f07 into eclipse-jdt:master Jan 20, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants